import java.awt.Point;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Stroke;



public class Draw{
	
	private Point p, q;
	Stroke def;
	Stroke thick;
	private Color drawColor;
	
	public Draw(Point p, Point q){
		this.p = p;
		this.q = q;

		thick= new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
		//Initial draw color is set to blue
		drawColor = Color.blue; 
	}


	public void moveEndpointTo(Point q){
		this.q = q;
	}

	public void drawSelf(Graphics2D g2) {
		def= g2.getStroke();
		
		g2.setStroke(thick);
		g2.setColor(drawColor);
		g2.drawLine(p.x, p.y, q.x, q.y);
		
		g2.setStroke(def);
	}
	public void setColor( Color c){
		drawColor = c;
	}
	
	public Point start(){
		return p;
	}
	public Point end(){
		return q;
	}
}